package components.list.item
{
	import capricornus.components.label.Label;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	
	internal class SimpleItem extends Sprite
	{
		private var _name:Label;
		private var _txtInput:TextField;
		
		public function SimpleItem()
		{
			_name = new Label();
			addChild( _name );
			
			_txtInput = new TextField();
			_txtInput.border = true;
			_txtInput.borderColor = 0;
			_txtInput.background = true;
			_txtInput.backgroundColor = 0xffffff;
			_txtInput.wordWrap = true;
			_txtInput.multiline = true;
			addChild( _txtInput );
		}
		
		public function set name( value:String ):void
		{
			_name.text = value;
			_txtInput.x = _name.width;
		}
		
		public function set editable( value:Boolean ):void
		{
			_txtInput.type = value?TextFieldType.INPUT:TextFieldType.DYNAMIC;
		}
	}
}